/**
 * @(#)RegexTest.java   2012-10-20
 * 
 * CopyRight (c) 2012-2020 TCL Digital Technology (shenzhen) CO.,Ltd. All rights reserved.
 * 
 * @description: 
 * 
 * @version: 1.0
 * 
 * @modification history:
 *     2012-10-20 Modified By zhaodm : Create
 * 
 * 
 */
package com.zhaodm.practise.string;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @description: 
 * 
 */
public class RegexTest {

	/**
	 * 
	 * @param args 
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		String param = "45:482514706753:64:6875:2.22:1.0";
		String[] nodes = param.split(":");
		System.out.println(nodes.toString());
		if (nodes.length >= 4) {
			int serviceId = Integer.parseInt(nodes[0]);
			System.out.println(serviceId);
			Matcher m = Pattern.compile("(\\d{3})").matcher(nodes[1]);
			String[] freqs = nodes[1].split("([\\d]{3})");
			while (m.find()) {
				System.out.println(m.group());
			}
			System.out.println(freqs.length);
		}
	}

}
